package com.maiji.cloud.microservice;

import com.maiji.cloud.entities.login.UploadRecord;
import com.maiji.cloud.request.BaseInputDto;
import com.maiji.cloud.request.SaveURBelongIdReqDto;
import com.maiji.cloud.response.BaseDataResDto;
import com.maiji.cloud.response.login.UploadImageResData;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@FeignClient(value = "MAIJICLOUD-APPLOGIN")
public interface UploadRecordService {

    /**
     *  修改图片上传记录
     * @param uploadRecord
     * @return
     */
    @PostMapping("/uploadRecord/updateUploadRecord")
    Boolean updateUploadRecord(@RequestBody UploadRecord uploadRecord);

    /**
     *  根据belongId重置图片归属
     * @param belongId
     * @return
     */
    @PostMapping("/uploadRecord/resetUploadRecord")
    Boolean resetUploadRecord (@RequestBody String belongId, @RequestHeader(name = "isMain") Integer isMain);

    /**
     *  批量修改图片上传记录
     * @param uploadRecords
     * @return
     */
    @PostMapping("/uploadRecord/updateBatchUploadRecord")
    Boolean updateBatchUploadRecord(@RequestBody List<UploadRecord> uploadRecords);

    /**
     *  批量保存图片上传记录
     * @param uploadRecords
     * @return
     */
    @PostMapping("/uploadRecord/insertBatchUploadRecord")
    Boolean insertBatchUploadRecord(@RequestBody List<UploadRecord> uploadRecords);

    /**
     *  根据belongId批量删除图片上传记录
     * @param belongId
     * @return
     */
    @PostMapping("/uploadRecord/delBatchByBelongId")
    Boolean delBatchByBelongId(@RequestBody String belongId);

    /**
     *  根据 belongId[] 批量获取图片
     * @param map
     * @return
     */
    @PostMapping("/uploadRecord/findAllByBelongIds")
    List<UploadRecord> findAllByBelongIds(@RequestBody Map<String, Object> map);

    /**
     *  根据 belongId[] 批量获取图片
     * @param belongIds
     * @return
     */
    @PostMapping("/uploadRecord/findAllByBelongIds0")
    List<UploadRecord> findAllByBelongIds(@RequestBody List<String> belongIds);

    /**
     *  根据 belongId[] 批量获取图片
     * @param map
     * @return
     */
    @PostMapping("/uploadRecord/findResDataList")
    List<UploadImageResData> findResDataList(@RequestBody Map<String, Object> map);

    /**
     * 设置资源列表的归属ID
     *
     * @param inputDto
     * @return
     */
    @PostMapping("/common/saveURBelongId")
    BaseDataResDto<Boolean> saveBelongId(BaseInputDto<ArrayList<SaveURBelongIdReqDto>> inputDto);

}
